# It is recommended to test the script on a local machine for its purpose and effects. # ManageEngine Endpoint Central will not be responsible for any # damage/loss to the data/setup based on the behavior of the script. # Description - Script to set time format # Parameters - "" # Configuration Type - USER/COMPUTERs # Example: EEE d MMM HH:mm:ss # EEE - day of the week (not mandatory) # d MMM represent the date and month (not mandatory , non - atomic) # HH represnts hours in 24 hour format (Mandatory) # mm is minutes (Mandatory) # ss is seconds (Mandatory) # the arguments should be present in the order mentioned in the example # Example: "Mon 6 Mar 15:30:45" # Example: "Fri 12 Apr 09:15:00" if [ $# == '1' ]; then defaults write com.apple.menuextra.clock "DateFormat" '$1' killall -KILL SystemUIServer # the killall kill is there to ensure that the changes take effect ret=$? if [ $ret == "0" ]; then echo "Format changed Successfully" else echo "Error in format change" fi exit $ret else echo "Invalid Arguments - Please refer description of the script" exit 1 fi